package com.wdb.modules.system.service.impl;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.wdb.modules.system.domain.Dict;
import com.wdb.modules.system.domain.vo.DictQueryCriteria;
import com.wdb.modules.system.mapper.DictMapper;
import com.wdb.modules.system.service.DictService;
import com.wdb.utils.PageResult;
import com.wdb.utils.PageUtil;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author: wendaobai@qq.com
 * @date: 2024/8/29 星期四 11:08
 */
@Service
@RequiredArgsConstructor
@Slf4j
public class DictServiceImpl extends ServiceImpl<DictMapper, Dict> implements DictService {
  private final DictMapper dictMapper;

  @Override
  public PageResult<Dict> queryAll(DictQueryCriteria criteria, Page<Object> page) {
    return PageUtil.toPage(dictMapper.queryAll(criteria, page));
  }

  @Override
  public List<Dict> queryAll(DictQueryCriteria dictQueryCriteria) {
    return dictMapper.findAll(dictQueryCriteria);
  }
}
